{load header}
<!--/H-->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
                        <!-- nav -->
            

            
	<div class="main-title">
		<h2>加息任务管理</h2>
	</div>
	<div class="cf">
            <a class="btn" id="getSuccessInvestsTask" href="javascript:void(0);" data-url="http://finance.tan.com/ExperAward/getSuccessInvestsTask.html">获取满标记录</a>
            <!--排序-->
<!--            【
            <a {if $order_name == 'hot'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=hot&hot_order={if $hot_order_val}{$hot_order_val}{else}desc{/if}">热门</a>
            <a {if $order_name == 'recommend'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=recommend&rec_order={if $rec_order_val}{$rec_order_val}{else}desc{/if}">推荐</a>
            <a {if $order_name == 'show'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=show&show_order={if $show_order_val}{$show_order_val}{else}desc{/if}">显示</a>
            <a {if $order_name == 'sort'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=sort&sort_order={if $sort_order_val}{$sort_order_val}{else}desc{/if}">排序</a>
            <a {if $order_name == 'readnum'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=readnum&read_order={if $read_order_val}{$read_order_val}{else}desc{/if}">阅读数</a>
            <a {if $order_name == 'answernum'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=answernum&answer_order={if $answer_order_val}{$answer_order_val}{else}desc{/if}">回答数</a>
            <a {if $order_name == 'likes'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=likes&likes_order={if $likes_order_val}{$likes_order_val}{else}desc{/if}">喜欢数</a>
            <a {if $order_name == 'focusnum'}class="btn"{/if} href="{eval echo site_url('community/wenda')}?order=focusnum&focus_order={if $focus_order_val}{$focus_order_val}{else}desc{/if}">关注数</a>
            】-->
            <!-- 高级搜索 -->
            <div class="search-form fr cf">
                    <div class="sleft">
                        <div class="drop-down drop-award">
                            <span id="sch-sort-txt-award" class="sort-txt" data="{if $st_type}{$st_type}{else}id{/if}">{if $st_name}{$st_name}{else}投资编号{/if}</span>
                            <i class="arrow arrow-down"></i>
                            <ul id="sub-sch-menu-award" class="nav-list hidden">
                                <li><a href="javascript:;" value="id">投资编号</a></li>
                                <li><a href="javascript:;" value="plat">平台名称</a></li>
                                <li><a href="javascript:;" value="name">用户名</a></li>
                            </ul>
                        </div>
                        <input type="text" name="q" class="search-input" value="{$key_name}" placeholder="请输入关键字"/>
                        <a class="sch-btn" href="javascript:void(0);" id="search" url=""><i class="btn-search"></i></a>
                    </div>
            </div>
	</div>
	<div class="tab-wrap">
		
		<div class="tab-content">
			
			<!-- 数据列表 -->
			<div class="data-table table-striped">
				<table>
					<thead>
						<tr>
						<th>投资编号(A)</th>
                                                <th>平台名称(EN)</th>
						<th>用户名(USER)</th>
                                                <th>标的名称</th>
                                                <th>投资订单</th>
                                                <th>总金额(￥)</th>
                                                <th>有效金额(￥)</th>
                                                <th>平台利率</th>
                                                <th>固定加息</th>
                                                <th>加息珠加息</th>
                                                <th>已获总加息(溜溜币)</th>
                                                <th>投资时间</th>
                                                <th>加息状态</th>
						<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<!--{loop $list $k1 $val}-->
						<tr>
                                                    <td>{$val['aid']}</td>
                                                    <td>{$val['plat_ch']}</td>
                                                    <td>{$val['username']}</td>
                                                    <td>{$val['title']}</td>
                                                    <td>{$val['oid_id']}</td>
                                                    <td>{$val['total_amount']}</td>
                                                    <td>{$val['amount']}</td>
                                                    <td>{$val['rate']}</td>
                                                    <td>{$val['add_interest']}</td>
                                                    <td>{$val['extra_interest']}</td>
                                                    <td>{$val['total_interest_finance']}</td>
                                                    <td>{$val['invest_time']}</td>
                                                    <td>
                                                       {if $val['status']}
                                                       <span class="red">加息中</span>
                                                        {else}
                                                        <span>已结束</span>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        <a title="查看" href="{eval echo site_url('interests/tasks_detail')}?id={$val['aid']}">加息明细</a>
                                                    </td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!-- 分页 -->
				<div class="page">
					<div>
					{$showpage}
					<span class="rows">共 {$Total} 条记录</span>
					</div>
				</div>
			</div>
	
		</div>
	</div>
<script>
    $(function(){
	//搜索功能
	$("#search").click(function(){
            
	var url = $(this).attr('url');
        var status = $("#sch-sort-txt-award").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
                if(status != ''){
                        query += '&st=' + status; //板块
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

	/* 状态搜索子菜单 */
	
	$(".search-form").find(".drop-award").hover(function(){
		$("#sub-sch-menu-award").removeClass("hidden");
		
	},function(){
		$("#sub-sch-menu-award").addClass("hidden");
		
	});
	$("#sub-sch-menu-award li").find("a").each(function(){
		$(this).click(function(){
			var text = $(this).text();
			$("#sch-sort-txt-award").text(text).attr("data",$(this).attr("value"));
			$("#sub-sch-menu-award").addClass("hidden");
		})
	});
    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });
     /* 实时更新分类信息 */
    $(".tab-content").on("submit", "form", function(){
        var self = $(this);
        $.post(
                self.attr("action"),
                self.serialize(),
                "json"
        );
        return false;
    }).on("focus","input",function(){
        $(this).data('param',$(this).closest("form").serialize());
    }).on("blur", "input", function(){
        if($(this).data('param')!=$(this).closest("form").serialize()){
            $(this).closest("form").submit();
        }
    });
    
    $("#getSuccessInvestsTask").on("click",function(){
        var _u = $(this).attr("data-url");
        $.get(_u,{},function(res){
            if(res.status == 1){
                alert("查询成功");
                window.location.reload();
            }else{
                alert("查询失败");
            }
          },"json");
    });
});  
</script>
<!--F-->{load footer}